home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / scsiDiskBoot / RCS / mem.c,v < prev    next >
Encoding:
Text File  |  1989-06-10  |  1.4 KB  |  90 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    mendel:1.1; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     86.07.18.11.51.25;  author nelson;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @/* mem.c -
  26.  *
  27.  *    This file contains a simple memory allocator.
  28.  *
  29.  * Copyright (C) 1985 Regents of the University of California
  30.  * All rights reserved.
  31.  */
  32.  
  33. #ifndef lint
  34. static char rcsid[] = "$Header: bootVm.c,v 1.1 86/07/16 17:12:02 brent Exp $ SPRITE (Berkeley)";
  35. #endif not lint
  36.  
  37. #include "sprite.h"
  38. #include "vmSunConst.h"
  39.  
  40. extern int endBss;    /* Defined in end.s */
  41.  
  42. /*
  43.  * Private storage for Mem_Alloc
  44.  */
  45. static Address    memEnd;
  46. static Boolean    memInitialized = FALSE;
  47.  
  48.  
  49. /*
  50.  * ----------------------------------------------------------------------------
  51.  *
  52.  * Mem_Alloc --
  53.  *
  54.  *     Allocate a block of memory of the given size starting at the
  55.  *     current end of kernel memory.
  56.  *
  57.  * Results:
  58.  *     A pointer to the allocated memory.
  59.  *
  60.  * Side effects:
  61.  *     memEnd is incremented.
  62.  *
  63.  * ----------------------------------------------------------------------------
  64.  */
  65.  
  66. Address
  67. Mem_Alloc(numBytes)
  68. {
  69.     Address    addr;
  70.  
  71.     if (!memInitialized) {
  72.     memEnd = (Address) (((int) &endBss + 3) & ~3);
  73.     memInitialized = TRUE;
  74.     }
  75.  
  76.     addr =  memEnd;
  77.  
  78.     memEnd += (numBytes + 3) & ~3;
  79.  
  80.     return(addr);
  81. }
  82.  
  83. void
  84. Mem_Free(address)
  85.     Address address;
  86. {
  87.     return;
  88. }
  89. @
  90.